DateFormatter
by Scott Weiner, NeXT Developer Training 
( Special thanks to Brian Pinkerton  for the original Formatter code)

Overview

In order to run this example, you need to have an adaptor, a model and a data source.   You should install the your .dbmodel file into your ~/Library/Databases directory.
This example shows how to create a formatter for a DBTableView that uses a subclass of TextFieldCell to validate the user's input.  The formatter forces the user to type in values of the form xx/xx/xx where x is a number (0-9).  

To use this example, drag two properties from the included DBModule in the .nib file into the DBTableView in the main window.  NOTE the second column should contain a property of type string.

Compile and run.  Press the Fetch button under the DBTableView and now try to edit some information in the columns.  Notice what happens when you try to type anything that is not of the form xx/xx/xx in the second column.

Program Organization

Major Classes in the Application

TableViewController	A general manager object.  A subclass of the Object class.  Performs miscellaneous 		initializations. 

DateFormatter		A subclass of DBFormatter.  Provides string validation for date values		
DateTFCell		A subclass of TextFieldCell.  Only allows values of the form xx/xx/xx to be entered.		
Topics Of Interest

- How to replace the format of your tableview columns with a subclass of DBFormatter
See the files TableViewController.[hm]

- How to create a subclass of DBFormatter which allow you to control user input
See the files DateFormatter.[hm], DateTFCell.[hm]

Change History
September 1992		Created for 3.0 Gold